home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-10-30 | 5.7 KB | 229 lines | [TEXT/CWIE] |
- { ModelessButtons.p -- modeless dialog }
- { Created 10/30/98 1:06 PM by AppMaker }
-
- Unit ModelessButtons;
- Interface
-
- Uses
- Types,
- Quickdraw,
- Controls,
- Dialogs,
- Events,
- Lists,
- Menus,
- TextEdit,
- AMDialog;
-
- Procedure ShowModelessButtons;
-
- type
- CModelessButtons = object (AMDialog)
-
- {data members}
- mInvisibleHandle: ControlHandle;
- mStandardHandle: ControlHandle;
- mDefaultHandle: ControlHandle;
- mBevelHandle: ControlHandle;
- mButtonHandle: ControlHandle;
- mNextHandle: ControlHandle;
- mNext2Handle: ControlHandle;
- mGraphicHandle: ControlHandle;
- mRightHandle: ControlHandle;
- mLightHandle: ControlHandle;
- mRight2Handle: ControlHandle;
- mButton2Handle: ControlHandle;
- mRight3Handle: ControlHandle;
- mRect3DHandle: ControlHandle;
- mLeftIconHandle: ControlHandle;
- mRightIconHandle: ControlHandle;
- mTitledPICTHandle: ControlHandle;
-
- {methods - public}
- Procedure ConnectToData (inData: AMSignaler); Override;
-
- {methods - internal}
- Procedure FinishMake; Override;
- Procedure DoItem (inItemHit: SInt16); Override;
- Procedure DataChanged (inDataID: longint); Override;
-
- end;
-
- var
- sModelessButtonsPtr: DialogPtr;
-
- {----------}
- Implementation
-
- Uses
- ResourceDefs,
- ControlUtils,
- Miscellany;
-
- const
- kCapInvisibleLabel = 1;
- kInvisibleButton = 2;
- kStandardButton = 3;
- kDefaultButton = 4;
- kBevelBox = 5;
- kButtonButton = 6;
- kNextButton = 7;
- kNext2Button = 8;
- kGraphicBox = 9;
- kCapcicnLabel = 10;
- kRightButton = 11;
- kCapicl8Label = 12;
- kLightButton = 13;
- kCapICNLabel = 14;
- kRight2Button = 15;
- kCapicl9Label = 16;
- kButton2Button = 17;
- kRight3Button = 18;
- kCapPICTLabel = 19;
- kRect3DButton = 20;
- kLeftIconButton = 21;
- kRightIconButton = 22;
- kTitledPICTButton = 23;
-
-
- {----------}
- Function NewModelessButtons: CModelessButtons;
- var
- dialog: CModelessButtons;
- begin
- dialog := nil;
- New (dialog);
-
- if dialog <> nil then begin
- dialog.Initialize;
- end;
- NewModelessButtons := dialog;
- end;
-
- {----------}
- Procedure CreateModelessButtons;
- var
- dialog: CModelessButtons;
- begin
- dialog := NewModelessButtons;
-
- dialog.MakeDialog (DLOG_ModelessButtons);
- end; {CreateModelessButtons}
-
- {----------}
- Procedure ShowModelessButtons;
- begin
- if sModelessButtonsPtr = nil then begin
- CreateModelessButtons;
- end;
- if sModelessButtonsPtr <> nil then begin
- SelectWindow (sModelessButtonsPtr);
- ShowWindow (sModelessButtonsPtr);
- end;
- end; {ShowModelessButtons}
-
- {----------}
- Procedure CModelessButtons.FinishMake;
- var
- errCode: OSErr;
- begin
- sModelessButtonsPtr := mDialog;
-
- mInvisibleHandle := GetControlItem (kInvisibleButton);
- mStandardHandle := GetControlItem (kStandardButton);
- mDefaultHandle := GetControlItem (kDefaultButton);
- SetDefaultState (mDefaultHandle, true);
- errCode := SetDialogDefaultItem (mDialog, kDefaultButton);
- mBevelHandle := GetControlItem (kBevelBox);
- mButtonHandle := GetControlItem (kButtonButton);
- errCode := SetBevelButtonGraphicAlignment (mButtonHandle, kControlBevelButtonAlignCenter, 0, 0);
- mNextHandle := GetControlItem (kNextButton);
- errCode := SetBevelButtonTextPlacement (mNextHandle, kControlBevelButtonPlaceToRightOfGraphic);
- errCode := SetBevelButtonTextAlignment (mNextHandle, kControlBevelButtonAlignTextFlushLeft, 0);
- errCode := SetBevelButtonGraphicAlignment (mNextHandle, kControlBevelButtonAlignLeft, 0, 0);
- mNext2Handle := GetControlItem (kNext2Button);
- errCode := SetBevelButtonTextPlacement (mNext2Handle, kControlBevelButtonPlaceBelowGraphic);
- errCode := SetBevelButtonTextAlignment (mNext2Handle, kControlBevelButtonAlignTextCenter, 0);
- errCode := SetBevelButtonGraphicAlignment (mNext2Handle, kControlBevelButtonAlignTop, 0, 0);
- mGraphicHandle := GetControlItem (kGraphicBox);
- mRightHandle := GetControlItem (kRightButton);
- mLightHandle := GetControlItem (kLightButton);
- mRight2Handle := GetControlItem (kRight2Button);
- mButton2Handle := GetControlItem (kButton2Button);
- mRight3Handle := GetControlItem (kRight3Button);
- mRect3DHandle := GetControlItem (kRect3DButton);
- mLeftIconHandle := GetControlItem (kLeftIconButton);
- mRightIconHandle := GetControlItem (kRightIconButton);
- mTitledPICTHandle := GetControlItem (kTitledPICTButton);
- end;
-
- {----------}
- Procedure CModelessButtons.ConnectToData (
- inData: AMSignaler); Override;
- begin
- inherited ConnectToData (inData);
-
- end;
-
- {----------}
- Procedure CModelessButtons.DoItem (
- inItemHit: SInt16);
- begin
- case inItemHit of
- kInvisibleButton:
- ;{? this button doesn't have a command }
- { DoInvisibleButton; }
- kStandardButton:
- ;{? this button doesn't have a command }
- { DoStandardButton; }
- kDefaultButton:
- ;{? this button doesn't have a command }
- { DoDefaultButton; }
- kButtonButton:
- ;{? this button doesn't have a command }
- { DoButtonButton; }
- kNextButton:
- ;{? this button doesn't have a command }
- { DoNextButton; }
- kNext2Button:
- ;{? this button doesn't have a command }
- { DoNext2Button; }
- kRightButton:
- ;{? this button doesn't have a command }
- { DoRightButton; }
- kLightButton:
- ;{? this button doesn't have a command }
- { DoLightButton; }
- kRight2Button:
- ;{? this button doesn't have a command }
- { DoRight2Button; }
- kButton2Button:
- ;{? this button doesn't have a command }
- { DoButton2Button; }
- kRight3Button:
- ;{? this button doesn't have a command }
- { DoRight3Button; }
- kRect3DButton:
- ;{? this button doesn't have a command }
- { DoRect3DButton; }
- kLeftIconButton:
- ;{? this button doesn't have a command }
- { DoLeftIconButton; }
- kRightIconButton:
- ;{? this button doesn't have a command }
- { DoRightIconButton; }
- kTitledPICTButton:
- ;{? this button doesn't have a command }
- { DoTitledPICTButton; }
-
- end; {switch}
- end;
-
- {----------}
- Procedure CModelessButtons.DataChanged (
- inDataID: longint); Override;
- begin
- end;
-
- End.
-